package com.catclay.adultmoon.dao;

import com.catclay.adultmoon.mapper.OrderMapper;
import com.catclay.adultmoon.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class OrderDao {

    @Autowired
    OrderMapper orderMapper;


    /**
     * 根据手机号查询物流单号
     * @param recePhone
     * @return
     */
    public String queryLogisticsByphone(String recePhone){
        System.out.println("recePhone="+recePhone);
        String lsi = orderMapper.queryLogisticsByphone(recePhone);
        System.out.println(recePhone+"的物流单号为："+lsi);
        return lsi;
    }

    /**
     * 获取所有订单
     * @return
     */
    public List<Order> getOrderList(){
        return orderMapper.getOrderList();
    }

    /**
     * 添加订单
     * @param order
     * @return
     */
    public int add(Order order){
        return orderMapper.add(order);
    }

    /**
     * 删除订单
     * @param id
     * @return
     */
    public int del(Integer id){
        return orderMapper.del(id);
    }
}
